{% extends base %}

{% block body %}
    {% include message/component/message_header.html %}

    {% include common/date/month_picker.html %}

    <div class="card">
        {% if len(message_list) == 0 %}
            {% include common/text/empty_text.html %}
        {% end %}

        {% for date, item_list, wday in message_list %}
            <a href="/message?date={{date}}" class="list-link">
                <span>{{date}} {{wday}}</span>
                <div class="float-right">
                    <span class="book-size-span">{{ len(item_list) }}</span>
                    <i class="fa fa-chevron-right"></i>
                </div>
            </a>
        {% end %}
    </div>

    <script type="text/javascript">
        $(function (e) {
            function onMonthSelected(event) {
                var date = event.target;
                window.location.href = "?date=" + date;
            }

            xnote.on("date.month.selected", onMonthSelected);
        })
    </script>

{% end %}
  